package com.splic.product.cusEnum;

/**
 * ==========================
 * 开发：singe
 * 创建时间：2022-02-28 22:11
 * 版本: 1.0
 * 描述：TODO
 * ==========================
 */
public enum WeekEnum {

    MONDAY("MONDAY",1,"星期一"),
    TUESDAY("TUESDAY",2,"星期二"),
    WEDNESDAY("WEDNESDAY",3,"星期三"),
    THURSDAY("THURSDAY",4,"星期四"),
    FRIDAY("FRIDAY",5,"星期五"),
    SATURDAY("SATURDAY",6,"星期六"),
    SUNDAY("SUNDAY",7,"星期天");

    private String code;
    private Integer weekDay;
    private String des;

    public String getCode() {
        return code;
    }

    public Integer getWeekDay() {
        return weekDay;
    }

    public String getDes() {
        return des;
    }

    WeekEnum(String code, Integer weekDay, String des) {
        this.code = code;
        this.weekDay = weekDay;
        this.des = des;
    }

    public static String getDesByWeekDay(Integer weekDay) {
        String result = null;
        for (WeekEnum order : WeekEnum.values()) {
            if (order.getWeekDay().equals(weekDay)) {
                result = order.getDes();
                break;
            }
        }
        return result;
    }

}